package com.example.design.leetcode;

/**
 * @Description 素数统计
 * @date 2023/9/18 14:52
 * @Author liuzhihui
 * @Version 1.0
 */
public class Susu {
    public static void main(String[] args) {
        System.out.println(susu(100));
    }

    private static int susu(int num) {
        int count = 0;
        for (int i = 2; i < num; i++) {
            count+=isPrime(i)?1:0;
        }
        return count;
    }

    private static boolean isPrime(int i) {
        for (int i1 = 2; i1 < i; i1++) {
            if (i%i1 == 0) {
                return false;
            }
        }
        return true;
    }
}
